package com.baicun.wish.main;


import com.baicun.wish.sink.SinkToCsv;
import com.baicun.wish.sink.SinkToCsv2;
import com.baicun.wish.spiders.CollegeAdmitSpider;
import com.baicun.wish.spiders.CollegeSpider;
import com.baicun.wish.spiders.ProvinceAdmitSpider;

/**
 * @author baicun
 * @description 主测试类 (之后用 SpringBoot controller接口测试)
 */
public class Main {
    public static void main(String[] args) throws Exception {

//        2.负责爬取 https://gkcx.eol.cn/school/(30-3560)/provinceline 大学录取，专业录取数据
        long begin = System.currentTimeMillis();

//        SinkToCsv.create("college_admit(30-50).csv");
        SinkToCsv2.create("college_major_admit(3450-3500).csv");


        for (int i = 3450; i < 3500 ; i++) {
             try{
                 CollegeAdmitSpider.getCollegeAdmit(i);
             }catch (Exception e){
                 e.printStackTrace();
             }
         }

//        SinkToCsv.close();
        SinkToCsv2.close();

        long end = System.currentTimeMillis();
        System.out.println((double)(end-begin)/1000);

    }
}
